---
title: Combobox
description: Combines a text input with a listbox, allowing users to filter a list of options to items matching a query.
kobalte: https://kobalte.dev/docs/core/components/combobox
---

<ComponentPreview name="combobox-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add combobox
```

</TabsContent>

<TabsContent value="manual">
<Steps>

<Step>Install the following dependencies: </Step>

```bash
pnpm install @kobalte/core solid-icons
```

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="combobox" />

</Steps>
</TabsContent>

</Tabs>

## Usage

```tsx
import {
  ComboboxContent,
  ComboboxControl,
  ComboboxInput,
  ComboboxItem,
  ComboboxItemIndicator,
  ComboboxItemLabel,
  ComboboxRoot,
  ComboboxSection,
  ComboboxTrigger
} from "~/registry/ui/combobox"
```

```tsx
const ALL_OPTIONS = ["Apple", "Banana", "Blueberry", "Grapes", "Pineapple"]

<ComboboxRoot
  options={ALL_OPTIONS}
  placeholder="Search a fruit..."
  itemComponent={(props) => (
    <ComboboxItem item={props.item}>
      <ComboboxItemLabel>{props.item.rawValue}</ComboboxItemLabel>
      <ComboboxItemIndicator />
    </ComboboxItem>
  )}
>
  <ComboboxControl aria-label="Fruit">
    <ComboboxInput />
    <ComboboxTrigger />
  </ComboboxControl>
  <ComboboxContent />
</ComboboxRoot>
```
